<template>
    <div>
        会员等级 ID={{id}}
    </div>
</template>

<script>
    export default {
        name: "MemberLevel",
        props: ['id'],
        beforeRouteEnter: (to, from, next) => {
            console.log("进入会员等级");
            next(vm=>{
                vm.getData();
            });
        },
        beforeRouteLeave: (to, from, next) => {
            console.log("离开会员等级");
            next();
        },
        methods:{
            getData:function () {
                this.axios({
                    method: 'get',
                    url:'http://10.24.7.107:8888/user/selectList'
                }).then(function (repos) {
                    console.log(repos);
                }).catch(function (error) {
                    console.log(error)
                })
            }
        }
    }
</script>

<style scoped>

</style>